<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <head>

        <title>Login</title>
    </head>
    <body>
        <ui:composition template="/template.xhtml">
            <ui:define name="top">
                <h:outputText value="IlusCode"></h:outputText>
            </ui:define>
            <ui:define name="left">

            </ui:define>
            <ui:define name="content">

                <div id="place"></div>

            </ui:define>
            <ui:define name="right">
                <h3> Iniciar Sesion</h3>
                <h:form>
                    <h:panelGrid columns="1">                       

                        <h:outputLabel value="Usuario" for="mail"/>
                        <h:inputText id="mail"  label="mail" value="#{usuarioController.email}" required="true">
                            <h:message for="mail" />
                            <f:validator validatorId="EmailValidator" />
                        </h:inputText>
                    </h:panelGrid>

                    <h:panelGrid colums="1">
                        <h:outputLabel value="Password" for="password"/>
                        <h:inputSecret id="password" label="password" required="true" value="#{usuarioController.password}">                       
                            <h:message  for="password"/>                             
                        </h:inputSecret>

                        <h:panelGroup/>
                        <h:commandButton id="login" value="Ingresar" action="#{usuarioController.login()}"/>

                    </h:panelGrid>          


                </h:form> 
                <h:form>
                    <h:panelGroup/>
                    <h:commandLink value="Crear usuario nuevo" action="/usuario/crearusuario"/>
                </h:form>
            </ui:define>
        </ui:composition>       


    </body>

</html>